package com.yxdj.user.controller;

import com.yxdj.common.core.web.domain.AjaxResult;
import com.yxdj.user.service.SMSService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "短信服务管理")
@RestController
@RequestMapping("/sms")
public class SMSController {

    @Autowired
    private SMSService smsService;

    @Operation(summary = "发送手机验证码")
    @GetMapping("/sendCode/{phone}")
    public AjaxResult sendCode(@PathVariable("phone") String phone) {
        //调用SMSService中发送手机验证码的方法
        smsService.sendCode(phone);
        return AjaxResult.success();
    }
}
